Fix relativizing directory on remotes that do not represent a path #205
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi.
While using the latest version of appraisal in one of my projects running in a docker container, I noticed that I could not run the application because the lock file was corrupt. Indeed, instead of
remote: https://github.com/thoughtbot/appraisal
, the lock file containedremote: https://github.com/thoughtbot..raisal
.I traced the error back to the
relativize
method ofAppraisal::Appraisal
:appraisal/lib/appraisal/appraisal.rb
Lines 104 to 112 in 40956d3
It replaces an absolute path by a relative one. In my case, my app was running in a
/app
folder, and therefore the "/app" part of "thoughtbot/appraisal" is replaced by "..".This PR solves this issue by replacing only the absolute paths that are preceded by a space. However, this may introduce a regression since I could not make any test of the current test suite fail when redefining the
relativize
method to just copy the content of the lock file without changing it. Therefore, I wonder ifrelativize
tries to solve an issue that cannot be reproduced anymore.